#ifndef _EB0_ENTITY_H_
#define _EB0_ENTITY_H_

#include <EB0/Prereq.h>
#include <EB0/Graphics/Renderable.h>
#include <EB0/Window/FrameListener.h>
#include <Box2D/Box2D.h>

namespace EB0
{
namespace Entities
{
	// An Entity is a Rederable object with a Physical representation
	// to be placed inside of a derived World State.
	class Entity : public Graphics::Renderable, public Window::FrameListener
	{
		friend class States::World;

	public:
		Entity();
		~Entity();

		b2Body* getBody() const;

	protected:
		b2BodyDef* mBodyDef; // could be a PolygonDef, CircleDef, etc... defined in the constructor or onAttach
		b2Body* mBody; // unable to inherit b2Body as bodies can only be created from within a world

	private:
		virtual void onAttach(States::World* worldState); // called to create the body
		virtual void onRemove(States::World* worldState); // called to destroy the body

		virtual void step(States::World* worldState, float dt = 0.0f); // where you might place AI...

		virtual void onFrameStart(Window::RenderWindow* window, float dt = 0.0f);
	};
} // namespace Entities
}

#endif // _EB0_ENTITY_H_